home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / _gs / !GS / h / GSSTATE < prev    next >
Text File  |  1991-10-25  |  4KB  |  98 lines

  1. /* Copyright (C) 1989, 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gsstate.h */
  21. /* Graphics state routines for Ghostscript library */
  22.  
  23. /* Opaque type for a graphics state */
  24. /*typedef struct gs_state_s gs_state;*/    /* defined in gs.h */
  25. extern const uint gs_state_sizeof;
  26.  
  27. /* Line cap values */
  28. typedef enum {
  29.     gs_cap_butt = 0,
  30.     gs_cap_round = 1,
  31.     gs_cap_square = 2
  32. } gs_line_cap;
  33.  
  34. /* Line join values */
  35. typedef enum {
  36.     gs_join_miter = 0,
  37.     gs_join_round = 1,
  38.     gs_join_bevel = 2
  39. } gs_line_join;
  40.  
  41. /* Allocation, freeing, and initialization */
  42. gs_state *gs_state_alloc(P2(proc_alloc_t, proc_free_t)); /* 0 if fails */
  43. int    gs_state_free(P1(gs_state *));
  44. int    gs_gsave(P1(gs_state *)),
  45.     gs_grestore(P1(gs_state *)),
  46.     gs_grestoreall(P1(gs_state *));
  47. gs_state *gs_state_swap_saved(P2(gs_state *, gs_state *));    /* special for save/restore */
  48. void    gs_state_swap(P2(gs_state *, gs_state *));    /* special for save/restore */
  49. int    gs_initgraphics(P1(gs_state *));
  50. /* Device control */
  51. #ifndef gx_device_DEFINED
  52. #  define gx_device_DEFINED
  53. typedef struct gx_device_s gx_device;
  54. #endif
  55. int    gs_flushpage(P1(gs_state *));
  56. int    gs_copypage(P1(gs_state *));
  57. int    gs_copyscanlines(P6(gx_device *, int, byte *, uint, int *, uint *));
  58. gx_device *    gs_getdevice(P1(int));
  59. int    gs_makedevice(P6(gx_device **, gx_device *, gs_matrix *, uint, uint, proc_alloc_t));
  60. int    gs_makeimagedevice(P7(gx_device **, gs_matrix *, uint, uint, float *, int, proc_alloc_t));
  61. void    gs_nulldevice(P1(gs_state *));
  62. int    gs_setdevice(P2(gs_state *, gx_device *));
  63. gx_device *    gs_currentdevice(P1(gs_state *));
  64. char *    gs_devicename(P1(gx_device *));
  65. void    gs_deviceparams(P4(gx_device *, gs_matrix *, int *, int *));
  66. int    gs_closedevice(P1(gx_device *));
  67.  
  68. /* Line parameters and quality */
  69. int    gs_setlinewidth(P2(gs_state *, floatp));
  70. float    gs_currentlinewidth(P1(gs_state *));
  71. int    gs_setlinecap(P2(gs_state *, gs_line_cap));
  72. gs_line_cap    gs_currentlinecap(P1(gs_state *));
  73. int    gs_setlinejoin(P2(gs_state *, gs_line_join));
  74. gs_line_join    gs_currentlinejoin(P1(gs_state *));
  75. int    gs_setmiterlimit(P2(gs_state *, floatp));
  76. float    gs_currentmiterlimit(P1(gs_state *));
  77. int    gs_setdash(P4(gs_state *, float *, uint, floatp));
  78. uint    gs_currentdash_length(P1(gs_state *));
  79. int    gs_currentdash_pattern(P2(gs_state *, float *));
  80. float    gs_currentdash_offset(P1(gs_state *));
  81. int    gs_setflat(P2(gs_state *, floatp));
  82. float    gs_currentflat(P1(gs_state *));
  83.  
  84. /* Color and gray */
  85. #include "gscolor.h"
  86.  
  87. /* Halftone screen */
  88. int    gs_setscreen(P4(gs_state *, floatp, floatp, float (*)(P2(floatp, floatp))));
  89. int    gs_currentscreen(P4(gs_state *, float *, float *, float (**)(P2(floatp, floatp))));
  90. int    gs_sethalftonephase(P3(gs_state *, int, int));
  91. int    gs_currenthalftonephase(P2(gs_state *, gs_int_point *));
  92. /* Enumeration-style screen definition */
  93. typedef struct gs_screen_enum_s gs_screen_enum;
  94. extern const uint gs_screen_enum_sizeof;
  95. int    gs_screen_init(P4(gs_screen_enum *, gs_state *, floatp, floatp));
  96. int    gs_screen_currentpoint(P2(gs_screen_enum *, gs_point *));
  97. int    gs_screen_next(P2(gs_screen_enum *, floatp));
  98.